using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WeaponReward : RewardBase
{
    //武器池
    public GameObject[] weapon;
    // public GameObject gerEffct;
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player") //other.CompareTag("Player"
        {
            int index = Random.Range(0, weapon.Length);
            //得到玩家脚本
            PlayerObject player = other.GetComponent<PlayerObject>();
            //调用切换武器方法
            player.ChangeWeapon(weapon[index]);
            RewardLifeCycle();
        }
    }
    // Start is called before the first frame update
}
